home *** CD-ROM | disk | FTP | other *** search
/ Learn Microsoft Visual Basic 6.0 Now / Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO / media / chap06 / b06d005.cc2 < prev    next >
Text File  |  1998-06-07  |  1KB  |  32 lines

  1. 0, In this demonstration, you'll see how a 
  2. 4, For...Next loop can modify the text size 
  3. 6, on a form by using the form's FontSize 
  4. 8, property. Now, every form has a FontSize 
  5. 11, property, but to adjust it, you have to 
  6. 13, use program code while the program is 
  7. 14, running. We'll do this inside a 
  8. 17, For...Next loop using the Print method we've been 
  9. 19, demonstrating in this chapter. First, 
  10. 21, we'll create a Command button to display 
  11. 23, the output and give it the name Loop by 
  12. 27, setting the Caption property in the 
  13. 29, Properties window. Next, we'll create an 
  14. 38, event procedure for the CommandButton's 
  15. 39, Click event, and build a For...Next loop 
  16. 42, that uses the Print method to display our 
  17. 44, output. We'll display the loop ten 
  18. 51, times. And each time through the loop, we'll 
  19. 57, print the word Line plus the line 
  20. 60, number, and we'll set the font size to be one 
  21. 66, point larger each time. When we run the 
  22. 77, program and click the Loop button, we 
  23. 79, can see what happens. The For...Next loop 
  24. 84, updates the FontSize property ten times 
  25. 86, and displays ten lines. If you think 
  26. 89, about it, the Visual Basic compiler has 
  27. 90, actually executed the equivalent of 20 
  28. 92, program statements here, although we only 
  29. 94, typed four lines in the event procedure. 
  30. 97, Pretty slick if you don't want to spend 
  31. 98, your development time typing.
  32. 102, END